#region

using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.InterceptionExtension;

#endregion

namespace SmartInspect.Extensions.Unity
{
    public class SiMethodCallAttribute : SiWrappedCallAttribute
    {
        public SiMethodCallAttribute()
        {
            Order = 2;
        }

        /// <summary>
        ///   Set this to true to log the getter and setter methods 
        ///   of properties.
        /// </summary>
        private bool EnableAccessorMethodLogging { get; set; }

        public override ICallHandler CreateHandler(IUnityContainer container)
        {
            return new SiMethodCallHandler
            {
                EnableAccessorMethodLogging = EnableAccessorMethodLogging,
                NamePrefix = NamePrefix,
                NameSuffix = NameSuffix,
                SuffixSeparator = SuffixSeparator,
                PrefixSeparator = PrefixSeparator,
                Level = Level,
                Order = Order,
                LogArgumentsToViewer = LogArgumentsToViewer,
                TypePolicy = TypePolicy
            };
        }
    }
}